#ifndef _DXINPUT_H
#define _DXINPUT_H

#include <dinput.h>


#define BUTTON_DOWN(obj, button) (obj.rgbButtons[button] & 0x80)
#define KEYBOARD_BUFFER_SIZE	1024

class DxInput
{
public:
	//DxInput();
	void _InitDirectInput(HINSTANCE, HWND);
	void _Process_KeyBoard();



	int IsKeyDown(int KeyCode);
	//them vao
	int IsKeyUp(int KeyCode);
	int IsKeyPress(int KeyCode);

	int GetKeyDown();
	int GetKeyUp();

	void _KillDirectInput();

	void _GetMouse();
protected:
private:
	HINSTANCE _hInstance;
	HWND _hWnd;

	BYTE  _KeyStates[256];			// DirectInput keyboard state buffer 

	//them vao
	BYTE  _KeyStatesPress[256];			// DirectInput keyboard state buffer 

	// Buffered keyboard data
	DIDEVICEOBJECTDATA _KeyEvents[KEYBOARD_BUFFER_SIZE];

	LPDIRECTINPUT8       _di;		// The DirectInput object         
	LPDIRECTINPUTDEVICE8 _Keyboard;	// The keyboard device
	int _Key_Down;
	int _Key_Up;

	LPDIRECTINPUTDEVICE8 _Mouse;
	DIMOUSESTATE _mouseState;
	int _xMouse;
	int _yMouse;

	POINT position;
};

#endif